#ifndef _SERVER_H_
#define _SERVER_H_

#include "handler.h"
#include <list>
using std::list;

class Server: public Thread
{
public:
    Server(unsigned int port);
    virtual ~Server();

    void run();
    void stop();

    void addHandler(ClientHandler* handler);
    void removeHandler(ClientHandler* handler);
private:
    int m_sock;
    unsigned int m_port;
    list<ClientHandler*> m_handlers;
};

#endif
